<link rel="stylesheet" href="/js/static/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/js/static/select2/4.0/select2.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/icheck/1.0/minimal/grey.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/jqGrid/4.7/css/ui.jqgrid.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/adminlte/css/AdminLTE.min.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/common/jeesite.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/adminlte/css/skins/skin-blue-light2.css?V4.2-01140807">
<link rel="stylesheet" href="/js/static/common/common.css?V4.2-01140807">

<form class="form-horizontal">
    <table id="dataGrid"></table>
    <!--    <div id="dataGridPage"></div>-->
    <script src="/js/global.min.js?ctx=/js/a"></script>
    <script src="/js/static/jquery/jquery-3.5.0.min.js"></script>
    <script src="/js/static/jquery/jquery-migrate-3.2.0.min.js"></script>
    <script src="/js/static/bootstrap/js/bootstrap.min.js"></script>
    <script src="/js/static/select2/4.0/select2.js?V4.2-01141009"></script>
    <script src="/js/static/select2/4.0/i18n/zh_CN.js?V4.2-01141009"></script>
    <script src="/js/static/layer/3.1/layer.js?V4.2-01141009"></script>
    <script src="/js/static/laydate/5.0/laydate.js?V4.2-01141009"></script>
    <script src="/js/static/jquery/jquery-ui-sortable-1.12.1.min.js"></script>
    <script src="/js/static/jqGrid/4.7/js/jquery.jqGrid.js?V4.2-01141009"></script>
    <script src="/js/static/jqGrid/4.7/js/jquery.jqGrid.extend.js?V4.2-01141009"></script>
    <script src="/js/static/jqGrid/4.7/js/i18n/zh_CN.js?V4.2-01141009"></script>
    <script src="/js/static/jquery-validation/1.16/jquery.validate.js?V4.2-01141009"></script>
    <script src="/js/static/jquery-validation/1.16/localization/messages_zh_CN.js?V4.2-01141009"></script>
    <script src="/js/static/jquery-validation/1.16/jquery.validate.extend.js?V4.2-01141009"></script>
    <script src="/js/static/common/jeesite.js?V4.2-01141009"></script>
    <script src="/js/static/common/i18n/jeesite_zh_CN.js?V4.2-01141009"></script>
    <script src="/js/static/common/common.js?V4.2-01141009"></script>
    <script>
        // var data = [//todo 从数据库获取
        //     {
        //         id: "aaa",
        //         warehouseName: "源材料仓",
        //         warehouseNumber: 3000,
        //     },
        //     {
        //         id: "ccc",
        //         warehouseName: "明矾仓",
        //         warehouseNumber: 1500,
        //     },
        // ];
        var data=${toJson(list)};
        $('#dataGrid').dataGrid({
            // searchForm: $("#searchForm"),
            data: ${toJson(list)},
            datatype: "local",
            columnModel: [
                {header: '主键', name: 'id', editable: true, hidden: true},
                {header: '${text("仓库")}', name: 'warehouseName', index: 'a.tally_date', width: 150, align: "center"},
                {header: '${text("仓库")}', name: 'warehouseId', index: 'a.tally_date', width: 150, align: "center",hidden:true},
                {header: '${text("数量")}', name: 'number', index: 'a.dept_code', width: 150, align: "left"},
                // {header: '${text("数量")}', name: 'warehouseId', index: 'a.dept_code', width: 150, align: "left"},
            ],
            // 加载成功后执行事件
            ajaxSuccess: function (data) {

            }
        });

        function commit() {
            var rowId = $('#dataGrid').dataGrid('getSelectRow');
            for (var i = 0; i < data.length; i++) {
                var item = data[i];
                if (rowId == item.id) return item;
            }
        }
    </script>
</form>
